package com.leetcode.LC;

public class LC1304 {
    public int[] sumZero(int n) {

        int[] ints = new int[n];
        boolean f = n % 2 == 0;//判断n是否为偶数
        int tmp = -(n / 2);
        if (f) {
            for (int i = 0; i < ints.length; i++) {
                ints[i] = tmp++;
                if (tmp == 0) {
                    tmp = 1;
                }
            }
        } else {
            for (int i = 0; i < ints.length; i++) {
                ints[i] = tmp++;
            }
        }
        return ints;
    }

    public static void main(String[] args) {
        for (int i : new LC1304().sumZero(1)) {
            System.out.print(i + ",");
        }
    }
}
